home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
DDJMAG
/
DDJ9203.ZIP
/
OOPASM.ZIP
/
VIDEO.MAC
< prev
next >
Wrap
Text File
|
1990-12-14
|
5KB
|
200 lines
COMMENT %
============================================================================
Sets the video mode.
===========================================================================%
videoMode MACRO Mode
IFDIF <Mode>,<al>
mov al,Mode
ENDIF
mov ah,00h ;Pass set video mode function code
int 10h ;BIOS interrupt
ENDM
COMMENT %
============================================================================
Selects the display page.
===========================================================================%
disPage MACRO Page
IFDIF <Page>,<al>
mov al,Page
ENDIF
mov ah,05h ;Pass set display page functioin code
int 10h ;BIOS interrupt
ENDM
COMMENT %
============================================================================
Sets the display page and video mode.
===========================================================================%
setVideoMode MACRO Page,Mode
disPage Page
videoMode Mode
ENDM
COMMENT %
============================================================================
Determines the current display page and video mode.
===========================================================================%
getVideoMode MACRO Page,Mode
mov ah,0Fh ;FUNCTION NUMBER FOR SERVICE
int 10h ;BIOS interrupt
IFDIF <Page>,<bh>
mov Page,bh ;Display page returned in bh
ENDIF
IFDIF <Mode>,<al>
mov Mode,al ;Video mode returned in al
ENDIF
ENDM
COMMENT %
============================================================================
Sets the border color.
===========================================================================%
setBorderColor MACRO Color
IFDIF <bl>,<Color>
mov bl,Color
ENDIF
mov cl,4
shr bl,cl ;Screen's background color
mov ah,0Bh ;Function code
mov bh,0 ;Want border color changed
int 10h
ENDM
COMMENT %
============================================================================
Reads character/attribute at current cursor position.
===========================================================================%
readChar MACRO Char,Attr,Page
IFNB <Page>
mov bh,Page ;Set given display page
ELSE
xor bh,bh ;Assume display page 0
ENDIF
mov ah,8 ;READ ATTR FUNCTION
int 10h ;BIOS interrupt
IFDIF <Attr>,<ah>
mov attr,ah ;Return attrib
ENDIF
IFDIF <Char>,<al>
mov char,al ;Return char
ENDIF
ENDM
COMMENT %
============================================================================
Returns the given reverse video attribute.
===========================================================================%
reverseVideo MACRO Reg
mov cl,4 ;Number of bits to rotate
rol Reg,cl
ENDM
COMMENT %
============================================================================
Returns the given attribute with intensity bit set.
===========================================================================%
intensityOn MACRO attr
or attr,00001000b
ENDM
COMMENT %
============================================================================
Returns the given attribute with intensity bit set to zero.
===========================================================================%
intensityOff MACRO attr
and attr,11110111b
ENDM
COMMENT %
============================================================================
Scrolls a screen area up.
===========================================================================%
scrlUp MACRO R1,C1,R2,C2,Color,Lines
getWinAttrs R1,C1,R2,C2,Color,Lines
mov ah,6 ;Pass scroll-up service number in ah
int 10h ;BIOS interrupt
ENDM
COMMENT %
============================================================================
Scrolls a screen area down.
===========================================================================%
scrlDn MACRO R1,C1,R2,C2,Color,Lines
getWinAttrs R1,C1,R2,C2,Color,Lines
mov ah,7 ;Pass scroll-down service number in ah
int 10h ;BIOS interrupt
ENDM
COMMENT %
============================================================================
Clears a screen area.
===========================================================================%
clrWin MACRO R1,C1,R2,C2,Color
getWinAttrs R1,C1,R2,C2,Color,0
mov ah,6 ;Pass scroll-up service number in ah
int 10h ;BIOS interrupt
ENDM
COMMENT %
============================================================================
Sets registers for window scrolling.
===========================================================================%
getWinAttrs MACRO R1,C1,R2,C2,Color,Lines
IFDIF <ch>,<R1>
mov ch,R1
ENDIF
IFDIF <cl>,<C1>
mov cl,C1
ENDIF
IFDIF <dh>,<R2>
mov dh,R2
ENDIF
IFDIF <dl>,<C2>
mov dl,C2
ENDIF
IFDIF <bh>,<Color>
mov bh,Color
ENDIF
IFDIF <al>,<Lines>
mov al,Lines
ENDIF
ENDM